<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <h1>实现promise</h1>
    <script src="./xuPromise.js"></script>
    <script>
        let p = new XuPromise((resolve, reject) => {
            setTimeout(function() {
                console.log(11111);
                resolve('成功');
            }, 3000)
        })
        p
            .then(res => console.log('success', res), err => console.log('feil', err))
            .then(res => console.log('success', res), err => console.log('feil', err))
            .then(res => console.log('success', res), err => console.log('feil', err))
            .then(res => console.log('success', res), err => console.log('feil', err))
    </script>
</body>
</html>